﻿namespace Microsoft.SharePoint.Client
{
    using System;
    using System.ComponentModel;

    [ScriptType("SP.WebTemplate", ServerTypeId="{2be10268-4be1-4b5a-850d-d06b137a9c40}")]
    public class WebTemplate : ClientObject
    {
        [EditorBrowsable(EditorBrowsableState.Never)]
        public WebTemplate(ClientRuntimeContext Context, ObjectPath ObjectPath) : base(Context, ObjectPath)
        {
        }

        protected override bool InitOnePropertyFromJson(string peekedName, JsonReader reader)
        {
            bool flag = base.InitOnePropertyFromJson(peekedName, reader);
            if (!flag)
            {
                switch (peekedName)
                {
                    case "Lcid":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["Lcid"] = reader.ReadUInt32();
                        return flag;

                    case "Id":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["Id"] = reader.ReadInt32();
                        return flag;

                    case "Title":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["Title"] = reader.ReadString();
                        return flag;

                    case "Name":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["Name"] = reader.ReadString();
                        return flag;

                    case "IsHidden":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["IsHidden"] = reader.ReadBoolean();
                        return flag;

                    case "Description":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["Description"] = reader.ReadString();
                        return flag;

                    case "ImageUrl":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["ImageUrl"] = reader.ReadString();
                        return flag;

                    case "IsRootWebOnly":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["IsRootWebOnly"] = reader.ReadBoolean();
                        return flag;

                    case "IsSubWebOnly":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["IsSubWebOnly"] = reader.ReadBoolean();
                        return flag;

                    case "DisplayCategory":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["DisplayCategory"] = reader.ReadString();
                        return flag;
                }
            }
            return flag;
        }

        [Remote]
        public string Description
        {
            get
            {
                base.CheckUninitializedProperty("Description");
                return (string) base.ObjectData.Properties["Description"];
            }
        }

        [Remote]
        public string DisplayCategory
        {
            get
            {
                base.CheckUninitializedProperty("DisplayCategory");
                return (string) base.ObjectData.Properties["DisplayCategory"];
            }
        }

        [Remote]
        public int Id
        {
            get
            {
                base.CheckUninitializedProperty("Id");
                return (int) base.ObjectData.Properties["Id"];
            }
        }

        [Remote]
        public string ImageUrl
        {
            get
            {
                base.CheckUninitializedProperty("ImageUrl");
                return (string) base.ObjectData.Properties["ImageUrl"];
            }
        }

        [Remote]
        public bool IsHidden
        {
            get
            {
                base.CheckUninitializedProperty("IsHidden");
                return (bool) base.ObjectData.Properties["IsHidden"];
            }
        }

        [Remote]
        public bool IsRootWebOnly
        {
            get
            {
                base.CheckUninitializedProperty("IsRootWebOnly");
                return (bool) base.ObjectData.Properties["IsRootWebOnly"];
            }
        }

        [Remote]
        public bool IsSubWebOnly
        {
            get
            {
                base.CheckUninitializedProperty("IsSubWebOnly");
                return (bool) base.ObjectData.Properties["IsSubWebOnly"];
            }
        }

        [Remote]
        public uint Lcid
        {
            get
            {
                base.CheckUninitializedProperty("Lcid");
                return (uint) base.ObjectData.Properties["Lcid"];
            }
        }

        [Remote]
        public string Name
        {
            get
            {
                base.CheckUninitializedProperty("Name");
                return (string) base.ObjectData.Properties["Name"];
            }
        }

        [Remote]
        public string Title
        {
            get
            {
                base.CheckUninitializedProperty("Title");
                return (string) base.ObjectData.Properties["Title"];
            }
        }
    }
}

